<?php
declare (strict_types = 1);
namespace thinkless;

use think\facade\Config;
use think\facade\Event;

/**
 * Serverless配置
 */
class Serverless {
    
    public static function boot(Thinkless $app) {
        // 腾讯Serverless
        if(getenv('TX_SERVERLESS')) {
            $app->setRuntimePath(DIRECTORY_SEPARATOR . 'tmp'.DIRECTORY_SEPARATOR.'runtime' . DIRECTORY_SEPARATOR);
            Event::listen('HttpRun', function() {
                // 用不了
                Config::set(['use_captcha' => false], 'security');
            });
        }
    }
}